package com.atguigu.webapp.service.impl;

import com.atguigu.model.pojo.BrowsingHistory;
import com.atguigu.webapp.mapper.BrowsingHistoryMapper;
import com.atguigu.webapp.service.BrowsingHistoryService;
import com.atguigu.webapp.vo.history.HistoryItemVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.Date;


/**
 * @Author 梅超凡
 * @Date 2024/11/12~21:44
 * @Description 针对表【browsing_history(浏览历史)】的数据库操作Service实现
*/
@Service
@Slf4j
public class BrowsingHistoryServiceImpl extends ServiceImpl<BrowsingHistoryMapper, BrowsingHistory>
        implements BrowsingHistoryService {


    @Autowired
    private BrowsingHistoryMapper browsingHistoryMapper;

    @Override
    public IPage<HistoryItemVo> pageHistoryItemByUserId(IPage<HistoryItemVo> voIPage, Long userId) {
        IPage<HistoryItemVo> itemVoIPage = browsingHistoryMapper.pageHistoryItemByUserId(voIPage, userId);
        log.info("查询结果：{}",itemVoIPage);
        return browsingHistoryMapper.pageHistoryItemByUserId(voIPage, userId);
    }
}




